
#!/bin/bash
#
#******************************************************************************************
#Author:                QianSong
#Date:                  2024-01-24
#FileName:              install.sh
#Description:           The test script
#Copyright (C):         QianSong 2024 All rights reserved
#******************************************************************************************

psname="costom_api"
project_name="costom_api:1.0.0"
echo "create docker image: $project_name"

pwd
npm install pnpm -g
pnpm i
pnpm run build

docker rm -f ${psname}
docker rmi ${project_name}

docker build --no-cache -t ${project_name} . 2>&1 | tee build.log
docker run --restart always -d --name ${psname} -p 8001:80  ${project_name}
docker logs -f ${psname}